class AuthException implements Exception {
  final String? message;
  final int? code;

  AuthException(this.message, {this.code});

  @override
  String toString() => '($code): $message';

  factory AuthException.badRequest(String message) =>
      AuthException(message, code: 400);

  factory AuthException.unauthorized(String message) =>
      AuthException(message, code: 401);

  factory AuthException.forbidden(String message) =>
      AuthException(message, code: 403);
}
